using System;
using UnityEngine;

public class GarbageCollect : MonoBehaviour
{
	public bool collectOnAwake = true;

	public bool collectContinuously = true;

	public int framesTillCollect = 30;

	private void Awake()
	{
		if (collectOnAwake)
		{
			GC.Collect();
		}
	}

	private void Update()
	{
		if (collectContinuously && Time.frameCount % framesTillCollect == 0)
		{
			GC.Collect();
		}
	}
}
